Skip to content

fix(a11y): fix contrast of keyboard shortcut labels#14831

Open
skjnldsv wants to merge 3 commits into
masterfrom
fix/bitv-9675-kbd-contrast
Open

fix(a11y): fix contrast of keyboard shortcut labels#14831
skjnldsv wants to merge 3 commits into
masterfrom
fix/bitv-9675-kbd-contrast

Conversation

@skjnldsv
Copy link
Copy Markdown
Member

☑️ Resolves

🖼️ Screenshots

kbd elements inherit the red code text color (#e74c3c), giving ~3.82:1 against white. WCAG AA / BITV 9.1.4.3 requires 4.5:1 for normal-weight text. The light border (#a6a6a6, ~2.4:1) also fails the 3:1 threshold for UI component outlines (WCAG 1.4.11).

Changes:

  • Text color overridden to #c0392b (~5.4:1 against white)
  • Border darkened to #767676 (~4.5:1 against white)

✅ Checklist

  • I have built the documentation locally and reviewed the output
  • Screenshots are included for visual changes
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

kbd elements inherit the red code text color (#e74c3c), which gives
~3.82:1 against white — below the 4.5:1 required for normal text
(WCAG 1.4.3 / BITV 9.1.4.3). The light border (#a6a6a6) also falls
short of the 3:1 required for UI component boundaries (WCAG 1.4.11).

Override text color to #c0392b (~5.4:1) and border to #767676 (~4.5:1).

Fixes #9675

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
@skjnldsv
Copy link
Copy Markdown
Member Author

skjnldsv commented May 12, 2026

Slight change of plan, sphinx supports proper keyboard shortcut html tags kbd
We should use those.

BUT, it looks like this, which is okay-ish. https://pr-14831--nextcloud-documentation.netlify.app/user_manual/en/universal_access.html#navigating-via-keyboard
Any opinions on it @nextcloud/designers ?

image

@nickvergessen
Copy link
Copy Markdown
Member

Is it dark enough also against the darkmode button?
grafik


Unrelated, but the pagination buttons are definetly not a11y anymore 🙈

@nickvergessen
Copy link
Copy Markdown
Member

the kbd looks is fine from my pov

@skjnldsv
Copy link
Copy Markdown
Member Author

Unrelated, but the pagination buttons are definetly not a11y anymore 🙈

They never were.
You can check how it looks on stable as well:
https://docs.nextcloud.com/server/stable/user_manual/en/
image

skjnldsv added a commit that referenced this pull request May 13, 2026
The recent BITV contrast fixes hardcoded colours that were chosen for
the white (light) background. The sphinx-rtd-dark-mode plugin switches
the content background to ~#141414 and code bg to #2d2d2d, making
those values fail WCAG AA in dark mode:

- .rst-content a: #2474a4 → 3.6:1 on #141414 (needs 4.5:1)
  Also silently overrides the plugin's --dark-link-color variable.
- code color: #c0392b !important → 2.4:1 on #2d2d2d (needs 4.5:1)
  The !important fully defeats the plugin's dark-mode rule.
- .wy-form-search-icon: #555 → ~1.7:1 on #0b152d sidebar (invisible)

Add html[data-theme="dark"] overrides that restore proper contrast
without touching the existing light-theme rules:
- Links: defer to var(--dark-link-color, #249ee8) (~6.1:1)
- Inline code: #ff7878 (~4.9:1 on #2d2d2d)
- Search icon: #aaa

Closes #14831

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BITV] 9.1.4.3/9.3 - Keyboard shortcuts do not meet the contrast requirements for texts. (1)

2 participants